package com.jungle.mvvm.sample.ui.login;

import com.jungle.mvvm.base.BaseModel;
import com.jungle.mvvm.sample.api.UserApi;
import com.jungle.mvvm.sample.bean.SameBean;
import com.jungle.mvvm.sample.bean.UserBean;
import com.jungle.mvvm.sample.http.WanNetwork;

import io.reactivex.Observable;

/**
 * 详细说明
 *
 * @author Daniel
 * @version V1.0
 * @date 2021/1/19 09:55
 */
public class LoginModel extends BaseModel {

    public static Observable<SameBean<UserBean>> login(String username, String password) {
        return WanNetwork.getService(UserApi.class)
                .login(username, password);
    }

    public static Observable<SameBean<UserBean>> register(String username, String password, String repassword) {
        return WanNetwork.getService(UserApi.class)
                .register(username, password, repassword);
    }

    public static Observable<SameBean<UserBean>> logout() {
        return WanNetwork.getService(UserApi.class)
                .logout();
    }
}
